package cn.huanba.controller;

import cn.huanba.client.OrderService;
import cn.huanba.entity.Order;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * (Order)表控制层
 *
 * @author makejava
 * @since 2021-01-07 17:23:24
 */
@RestController
@RequestMapping("order")
@Api(value = "订单控制类", tags = "订单控制类", description = "订单模块控制类描述")
public class OrderController {
    /**
     * 服务对象
     */
    @Resource
    private OrderService orderService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    @ApiOperation(value = "获取订单对象", notes = "通过订单编号获取订单对象")
    @ApiImplicitParam(name = "id", value = "订单编号", paramType = "query", required = true, dataType = "Integer")

    public Order selectOne(Integer id) {
        return this.orderService.queryById(id);
    }

}